package com.cuijq.ms.template.v4;


import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author by CuiJQ
 * @Classname JdbcTemplateDemo
 * @Description JdbcTemplateDemo Description
 * @Date 2021/5/28 20:38
 */
public class JdbcTemplateDemo {

  private JdbcTemplate jdbcTemplate;

  public User queryUser(long id) {
    String sql = "select * from user where id=" + id;
    return (User) jdbcTemplate.query(sql, new UserRowMapper()).get(0);
  }
}
